package pe.edu.upc.dsd.mercadolibreres;

import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

@Path ("/User")//identifca el recurso REST
public class UserService {
	@GET
	@Path ("/saludar")
public String saludar(){
	return "ok user";
	}	
	
	@PUT
		@Path ("Insert/{idU}/{nom}/{pass}")
		public void Insert(@PathParam("idU") int idU, 
				@PathParam("nom") String nom,
				@PathParam("pass") String pass)
						throws DAOExcepcion{
			User us = new User();
			us.setId(idU);
			us.setNombre(nom);
			us.setPass(pass);
			
			UserDao dao = new UserDao();
			dao.GuardarUser(us);	 
			
		}
}
